// pages/swipeview/swipe.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    inputValue:"",
    mycontrols:true,
    danmulist: [{ text: 'first', color: '#ff0000' },
    { text: 'first1', color: '#ff0000' ,time:15 },
    { text: 'first2', color: '#ff0000', time: 20 },
    { text: 'first3', color: '#ff0000', time: 17 },
    { text: 'adfa', color: '#ff0000', time: 14 }
    ]
  },
  mybindtap: function () {
    this.videoContext.sendDanmu({
      text: this.inputValue,
      color: '#ff0000' 
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
   
  },
  mybindinput: function (e) {
    this.inputValue = e.detail.value
    console.log("mybindinput" +e.detail.value)
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    this.videoContext = wx.createVideoContext('myvideo')
    this.audioCtx = wx.createAudioContext('myAudio')
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },
  audioPlay: function () {
    this.audioCtx.play()
  },
  audioPause: function () {
    this.audioCtx.pause()
  },
  audio14: function () {
    this.audioCtx.seek(14)
  },
  audioStart: function () {
    this.audioCtx.seek(0)
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  }
})